package com.ruoyi.user.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.user.domain.Sleep;
import com.ruoyi.user.mapper.SleepMapper;

/**
 * 睡眠 服务层实现
 * 
 * @author ruoyi
 * @date 2019-01-16
 */
@Service
public class SleepServiceImpl implements ISleepService 
{
	@Autowired
	private SleepMapper sleepMapper;

	/**
     * 查询睡眠信息
     * 
     * @param id 睡眠ID
     * @return 睡眠信息
     */
    @Override
	public Sleep selectSleepById(Integer id)
	{
	    return sleepMapper.selectSleepById(id);
	}
	
	/**
     * 查询睡眠列表
     * 
     * @param sleep 睡眠信息
     * @return 睡眠集合
     */
	@Override
	public List<Sleep> selectSleepList(Sleep sleep)
	{
	    return sleepMapper.selectSleepList(sleep);
	}
	
    /**
     * 新增睡眠
     * 
     * @param sleep 睡眠信息
     * @return 结果
     */
	@Override
	public int insertSleep(Sleep sleep)
	{
	    return sleepMapper.insertSleep(sleep);
	}
	
	/**
     * 修改睡眠
     * 
     * @param sleep 睡眠信息
     * @return 结果
     */
	@Override
	public int updateSleep(Sleep sleep)
	{
	    return sleepMapper.updateSleep(sleep);
	}

	/**
     * 删除睡眠对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteSleepByIds(String ids)
	{
		return sleepMapper.deleteSleepByIds(Convert.toStrArray(ids));
	}
	
}
